package com.ccom.api.feign.factory;

import com.ccom.api.feign.SysBaseFeign;
import com.ccom.api.feign.fallback.SysBaseFeignFallback;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * FallbackFactory 检查回退原因
 */
@Component
public class SysBaseAPIFallbackFactory implements FallbackFactory<SysBaseFeign> {

    @Override
    public SysBaseFeign create(Throwable throwable) {
        SysBaseFeignFallback fallback = new SysBaseFeignFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}